﻿using System.Threading.Tasks;

namespace CancellationTokenDemo
{
    internal class Program
    {
        static async Task Main(string[] args)
        {
            Console.WriteLine("Hello, World!");

            await Demo1().ConfigureAwait(false);

            Console.ReadKey();
        }


        public static async Task Demo1()
        {
            var task01 = Task.Run(async () =>
            {
                Console.WriteLine("开始执行任务");
                await Task.Delay(5000);
                Console.WriteLine("任务执行完毕");
            });

            await Task.WhenAll(task01);
        }
    }
}
